package com.youpai.platform.wallet.web.entity.resp;

import com.youpai.platform.wallet.web.enums.ChangeCoinResultEnum;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

/**
 * @date: 2023/2/26
 * @author: Welles
 * @version: 1.0
 * @description: 增加coin返回结果
 */
@Data
@Accessors(chain = true)
@NoArgsConstructor
public class ChangeCoinResp {

    /**
     * 处理是否成功
     * {@link ChangeCoinResultEnum}
     */
    public Integer processCode;

    /**
     * 处理结果消息
     */
    public String processMsg;

    public static ChangeCoinResp buildChangeCoinResultByEnum(ChangeCoinResultEnum changeCoinResultEnum) {
        return new ChangeCoinResp()
                .setProcessCode(changeCoinResultEnum.code)
                .setProcessMsg(changeCoinResultEnum.msg);
    }
}
